package org.ddmf.frame.dao;

import com.ibatis.common.resources.Resources;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.ibatis.sqlmap.client.SqlMapClientBuilder;

import java.io.IOException;
import java.io.Reader;

public class DaoConfig {


  private static final String resource = "ibatis-config-2.xml";
  private static final Reader reader;
  private static final SqlMapClient sqlMapClient; 
  
  static {
 
    	try{
			reader = Resources.getResourceAsReader(resource);
		}catch (IOException e){
			throw new RuntimeException("Description.  Cause: " + e, e);
		}
			sqlMapClient = SqlMapClientBuilder.buildSqlMapClient(reader);	
  }

	public static SqlMapClient getSqlMapClient(){

		return sqlMapClient;		
	}

}
